/*
 * Copyright (c) 2013-2014, thinkjoy Inc. All Rights Reserved.
 *
 * Project Name: wy
 * $Id:  CmsUserServiceImpl.java 2016-01-21 15:58:24 $
 */
package com.wy.service.impl.ex;

import com.wy.dao.ex.ICommentExDAO;
import com.wy.domain.Comment;
import com.wy.protocol.PageQuery;
import com.wy.service.ex.ICommentExService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("CommentExServiceImpl")
public class CommentExServiceImpl implements ICommentExService {

    @Autowired
    private ICommentExDAO commentExDAO;

    @Override
    public List<Comment> findPage(PageQuery pageQuery) throws Exception {
        Map<String,Object> params = new HashMap<>();
        params.put("pageSize",pageQuery.getPageSize());
        params.put("startId",pageQuery.getStartId());
        params.put("startDate",pageQuery.getStartDate());
        return commentExDAO.findPage(params);
    }

    @Override
    public int findCount() throws Exception {
        Map<String,Object> params = new HashMap<>();
        return commentExDAO.findCount(params);
    }
}
